<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html {
            height: 100%;
        }

        body {
            position: relative;
            height: 100%;
        }

        div {
            height: 600px;
            width: 600px;
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            right: 0;
            margin: auto;
        }

        div>img:nth-of-type(2) {
            position: absolute;
            left: 285px;
        }

        div>img:nth-of-type(3) {
            position: absolute;
            left: 285px;
        }

        div>img:nth-of-type(4) {
            position: absolute;
            left: 285px;
        }
    </style>
</head>

<body>
    <div>
        <img src="./img/clock.jpg" alt="">
        <img src="./img/hour.png" alt="">
        <img src="./img/minute.png" alt="">
        <img src="./img/second.png" alt="">
    </div>



</body>

</html>
<script>
    let img = document.querySelectorAll('img')

    setInterval(function () {
        let nowTime = new Date()
        let nowMin = nowTime.getMinutes()
        let nowSec = nowTime.getSeconds()
        let nowHour = nowTime.getHours()
        let haomiao = nowTime.getTime()
        img[3].setAttribute('style', `transform:rotate(${360*haomiao/60000 - 360}deg)`)
        img[2].setAttribute('style', `transform:rotate(${nowMin * 6 + nowSec/10}deg)`)
        img[1].setAttribute('style', `transform:rotate(${nowHour%12 * 30 + nowMin/2}deg)`)
    }, 1)

</script>